<link type="text/css" href="<?=base_url();?>css/tabs.css" rel="stylesheet" />
<script language="javascript">
	function deleteJob(url_delete){
	if (confirm("Are you sure you want to delete this job wanted?")	){
			window.location=url_delete;
		}
	}
</script>
<div id="border">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top">
            
        <table width="100%" border="0" id="usertitle">
          <tr>
            <td><h3 style="color:#329FE5;"><?=$users["user_fname"];?> <?=$users["user_lname"];?></h3></td>
            <td align="center"><span class="success_message"><?=$success_message?></span></td>
            <td align="right" valign="bottom"> <a href="<?=site_url('users/updateProfile')?>"><input class="post_ads" name="" type="button" value=" <?=$Z_TRANS->value('title_edit_profile')?> " /></a></td>
          </tr>
        </table>
          <div id="profile">
            <div class="user_line_border_top">&nbsp;</div>
                  <form action="<?=site_url("users/gosignup")?>" method="post" name="Frmsignup" id="Frmsignup">
                      <table width="680" border="0" align="center" cellpadding="0" cellspacing="0" style="font-size:11px">
                        <tr>
                          <td width="174" align="right" bgcolor="#F3F3F3" class="ttd"><?=$Z_TRANS->value('title_email')?>:</td>
                          <td width="456" colspan="2" bgcolor="#F3F3F3" class="ttd"><?=$users["user_email"];?></td>
                        </tr>
                         <tr>
                          <td align="right" bgcolor="#EEEEEE" class="ttd"><?=$Z_TRANS->value('title_name')?>:</td>
                          <td bgcolor="#EEEEEE" class="ttd"><?=$users["user_login"];?></td>
                          <td width="24%" align="left" bgcolor="#EEEEEE" class="ttd" style="border-left:#EEE 1px solid">
                           <div class="profile_picture">
							<? $Z_USER = Zsession::getUserFromSession();
                               $str_path = str_replace("\\", "/", FCPATH);
                               $filename =$str_path."usr/".$Z_USER["user_id"]."/".$users['user_photo'];
                                if($users["user_photo"]!="" && file_exists ($filename)){
                                    //echo $users["user_photo"];?>
                                <a href="<?=site_url('users/updateProfile')?>"><img src="<?=base_url();?>usr/<?=$Z_USER["user_id"]?>/<?=htmlspecialchars($users["user_photo"]);?>" height="80" border="0" align="absmiddle" /></a>
                            <? }else {?>
                                <img src="<?=base_url();?>images/People.png" height="80" align="absmiddle" />
                            <? }?>
                                <p style="margin-top:10px"><?=$Z_TRANS->value('title_profile_picture')?></p>
             
                            </div>
                
                          </td>
                        </tr>
                         <tr>
                          <td align="right" bgcolor="#F3F3F3" class="ttd"><?=$Z_TRANS->value('title_first_name')?>:</td>
                          <td colspan="2" bgcolor="#F3F3F3" class="ttd"><?=$users["user_fname"];?></td>
                        </tr>
                        <tr>
                          <td align="right" bgcolor="#EEEEEE" class="ttd"><?=$Z_TRANS->value('title_last_name')?>:</td>
                          <td colspan="2" bgcolor="#EEEEEE" class="ttd"><?=$users["user_lname"];?></td>
                        </tr>
                        <tr>
                          <td align="right" bgcolor="#F3F3F3" class="ttd"><?=$Z_TRANS->value('title_phone')?>:</td>
                          <td colspan="2" bgcolor="#F3F3F3" class="ttd"><?=$users["user_tel"];?></td>
                        </tr>
                        <tr>
                          <td align="right" bgcolor="#EEEEEE" class="ttd"><?=$Z_TRANS->value('title_locations')?>:</td>
                          <td colspan="2" bgcolor="#EEEEEE" class="ttd"><?=$users["city_name"];?></td>
                        </tr>          
                        <tr>
                          <td align="right" bgcolor="#F3F3F3" class="ttd"><?=$Z_TRANS->value('title_question')?>:</td>
                          <td colspan="2" bgcolor="#F3F3F3" class="ttd"><?=$users["sec_question_text"];?></td>
                        </tr>
                        
                        <tr>
                          <td align="right" bgcolor="#EEEEEE" class="ttd"><?=$Z_TRANS->value('title_answer')?>:</td>
                          <td colspan="2" bgcolor="#EEEEEE" class="ttd"><?=$users["sec_answer"];?></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr>
                          <td colspan="3">
                          
   					<!----------- menu tab ---------------------> 
        
        			<? 	$type=isset($_GET["type"]) ? $_GET["type"] : null;
						$str_path = str_replace("\\", "/", FCPATH);	         			
        				$type = Zencryption::decrypt($type);
        				$type = unserialize($type); 
						if($type=="properties"){?>
                        	<? $class = serialize("classified");
							   $jobs = serialize("jobs"); ?>
                            <div id="tab_header">
                            <ul id="primary">
                                <li><a href="<?=site_url("users/profiles")?>?type=<?=Zencryption::encrypt($class)?>"><?=$Z_TRANS->value('menu_classified_ads')?></a></li>
                                <li><span><?=$Z_TRANS->value('menu_property')?></span></li>
                                <li><a href="<?=site_url("users/profiles")?>?type=<?=Zencryption::encrypt($jobs)?>"><?=$Z_TRANS->value('menu_job_announ')?></a></li>
                            </ul>
                            </div>
                            
                            <div id="main">
                            	<div class="profile_quick_bottom"><a href="<?=site_url("property/p")?>"><input class="post_ads" name="" type="button" value=" <?=$Z_TRANS->value('menu_post_property')?> " /></a></div>
							<div id="contents" style="clear:both;">
                            <?php foreach($result_pro->result_array() as $row_pro): ?>
                            <table width="100%" border="0" class="left_ttb_border">
                                <tr>
                                  <td width="17%" height="60" align="center" valign="middle">
                                  <? $filename = $str_path.$row_pro['file_path'].$row_pro['pic_name'];
								  	if(isset($row_pro['pic_name']) && file_exists ($filename)){?>
                                  	<img src="<?=base_url();?><?=$row_pro['file_path'];?><?=$row_pro['pic_name'];?>" width="68" />
                                  <? }else {?>
                                  	<img src="<?=base_url();?>images/nopic.gif" width="68" />
                                  <? }?>
                                  </td>
                                  <td width="41%" valign="top"><b><a href="<?=site_url("property/detail/".$row_pro['property_id'])?>"> <? echo substr($row_pro['property_name'],0,39)." ";?></a></b> <span class="price"><?=$row_pro['property_price']?></span> <div class="cat_desc"><? echo substr($row_pro['description'],0,100)."..";?></div></td>
                                  <td width="23%" valign="top">
                                  <b><?=$row_pro['date_create']?></b> <?=$Z_TRANS->value('title_from')?> <?=$row_pro['user_upload']?><br />1 <?=$Z_TRANS->value('title_hit')?>
                                  </td>
                                  <td width="19%" align="right" valign="top"><div style="margin-bottom:5px;"><a href="<?=site_url("property/u")?>?proid=<?=Zencryption::encrypt(serialize($row_pro['property_id']))?>"><?=$Z_TRANS->value('title_edit')?></a> | <a href="javascript:del_property('<?=site_url("property/del_property/".Zencryption::encrypt(serialize($row_pro["property_id"])))?>')"><?=$Z_TRANS->value('title_delete')?></a></div></td>
                                </tr>
                            </table>
                            <?php endforeach;?>	
                            </div></div>    <br />
                         <? }else if($type=="classified"){?> 
                         	<? $pro = serialize("properties");
							   $jobs = serialize("jobs"); ?>
                         	<div id="tab_header">
                            <ul id="primary">
                                <li><span><?=$Z_TRANS->value('menu_classified_ads')?></span></li>
                                <li><a href="<?=site_url("users/profiles")?>?type=<?=Zencryption::encrypt($pro)?>"><?=$Z_TRANS->value('menu_property')?></a></li>
                                <li><a href="<?=site_url("users/profiles")?>?type=<?=Zencryption::encrypt($jobs)?>"><?=$Z_TRANS->value('menu_job_announ')?></a></li>
                            </ul>
                            </div>
                            
                            <div id="main">
							<div class="profile_quick_bottom"><a href="<?=site_url("classify/goto_addnew_classify");?>"><input class="post_ads" name="" type="button" value=" <?=$Z_TRANS->value('menu_post_Free_ads')?> " /></a></div>
							<div id="contents">
                            <?php foreach($result_class->result() as $row_class): ?>
                            <table width="100%" border="0" class="left_ttb_border">
                                <tr>
                                  <td width="15%" height="60" align="center" valign="middle">
                                  <a href="<?=site_url("classify/goto_classify_detail/$row_class->product_id");?>">
									<?php $getimg = $this->m_classify->select_first_img($row_class->product_id);
										  $filename = $str_path.$row_class->file_path.$getimg['img_name'];?>
                                    <?php if($getimg['img_name']!='' && file_exists ($filename)){ ?>
                                      <img src="<?=base_url();?><?=$row_class->file_path;?><?=$getimg['img_name'];?>" width="68"/>
                                    <?php }else{?>
                                      <img src="<?=base_url();?>images/nopic.gif" width="68"/>
                                    <? } ?>
                                    </a></td>
                                  <td width="40%" valign="top"><b><a href="<?=site_url("classify/goto_classify_detail/$row_class->product_id");?>"> <? echo substr($row_class->product_name,0,39)." ";?></a></b> <span class="price">$<?=$row_class->price;?></span> <div class="cat_desc"><? echo substr($row_class->product_desc,0,100)."..";?></div></td>
                                  <td width="23%" valign="top">
                                  <b><?=htmlspecialchars(date_postgres_to_html($row_class->date_post));?></b><br />
                                  <?php $total_hit=$this->m_classify->get_product_hit($row_class->product_id); ?>
          							<font color="#FF0000"><?=count($total_hit->result());?></font> <?=$Z_TRANS->value('title_hit')?>
                                  </td>
                                  <td width="19%" align="right" valign="top">
                                  	<div style="margin-bottom:5px;">
                                    	<a href="<?=site_url("classify/goto_update_classify/$row_class->product_id")?>"><?=$Z_TRANS->value('title_edit')?></a> |
                                        <a href="<?=site_url("classify/renew/".$row_class->product_id);?>">Renew</a> | 
                                        <a href="javascript:del_property('<?=site_url("classify/delete_classify/$row_class->product_id");?>')"><?=$Z_TRANS->value('title_delete')?></a>&nbsp;&nbsp;
                                    </div>    
                                  </td>
                                </tr>
                            </table>
                            <?php endforeach;?>	
                            </div></div>    <br />
                          <? }else if($type=="jobs"){?> 
                         	<? $pro = serialize("properties");
							   $class = serialize("classified");
							 ?>
                         	<div id="tab_header">
                            <ul id="primary">
                                <li><a href="<?=site_url("users/profiles")?>?type=<?=Zencryption::encrypt($class)?>"><?=$Z_TRANS->value('menu_classified_ads')?></a></li>
                                <li><a href="<?=site_url("users/profiles")?>?type=<?=Zencryption::encrypt($pro)?>"><?=$Z_TRANS->value('menu_property')?></a></li>
                                <li><span><?=$Z_TRANS->value('menu_job_announ')?></span></li>
                            </ul>
                            </div>
                            
                            <div id="main">
                            <div class="profile_quick_bottom"><a href="<?=site_url("job_wanted")?>"><input class="post_ads" name="" type="button" value=" <?=$Z_TRANS->value('menu_post_job')?> " /></a></div>
							<div id="contents">
                            <?php foreach($alljobs->result_array() as $job): ?>
                            <table width="100%" border="0" class="left_ttb_border">
                                <tr>
                                  <td width="11%" height="60" align="center" valign="middle">
                                  <a href="<?=site_url();?>/job_wanted/detail/<?=$job["job_wan_id"]?>">
									<?php $filename=$str_path."usr/".$job["user_id"]."/".$job["user_photo"];?>
									<?php if($job["user_photo"]!='' && file_exists ($filename)){ ?>
                                  <img src="<?=base_url();?>usr/<?=$job["user_id"]?>/<?=$job['user_photo'];?>" width="68"/>
                                    <?php }else{?>
                                      <img src="<?=base_url();?>images/nopic.gif" width="68"/>
                                    <? } ?>
                                  </a>
                                  </td>
                                  <td width="63%" height="60" valign="top"><b><a href="<?=site_url();?>/job_wanted/detail/<?=$job["job_wan_id"]?>"><?=htmlspecialchars($job["job_wan_subject"])?></a></b><div class="cat_desc"><?=htmlspecialchars(substr($job['job_wan_desc'],0,80))."..";?></div></td>
                                  <td width="9%" valign="top">  <?=$Z_TRANS->value('title_posted_on')?><br /><b><?=$job["date_create"]?></b> </td>
                                  <td width="17%" align="right" valign="top"><a href="<?=site_url("job_wanted/showupdate_job/".$job["job_wan_id"])?>"><?=$Z_TRANS->value('title_edit')?></a> | <a href="javascript:deleteJob('<?=site_url("job_wanted/delete_job/".$job["job_wan_id"])?>')"><?=$Z_TRANS->value('title_delete')?></a></td>
                                </tr>
                            </table>
                            <?php endforeach;?>	
                            </div></div>    <br />
                         <? }?>                                             
          <!-- ----------------- end menu -------------------- -->
                          </td>
                        </tr>
                      </table>
            </form>
          </div>
        </td>
        <td width="254" valign="top">
			<?php include APPPATH."views/templates/common/right_content.php"; ?>
         </td>
         
      </tr>
  </table>
	<script language="javascript">	
		function del_property(execute){
			if(confirm("Are you sure you want to delete this property?")){
				window.location=execute;
			}else{
				return false;
			}
		}
	</script>

</div>



